<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>AdminLTE 2 | Log in</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="/plugin/bootstrap-3.3.7/css/bootstrap.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/plugin/font-awesome-4.7.0/css/font-awesome.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="/plugin/AdminLTE-2.4-rc/css/AdminLTE.css">
</head>
<body class="hold-transition login-page">
<div class="login-box">
    <div class="login-logo">
        <a href="#">管理员后台</a>
    </div>
    <!-- /.login-logo -->

    <div class="nav-tabs-custom">
        <ul class="nav nav-tabs" style="width: 100%">
            <li class="active" style="width: 50%;margin-right: 0;"><a href="#login_box" data-toggle="tab" class="text-center">登陆</a></li>
            <li style="width: 50%;margin-right: 0;"><a href="#register_box" data-toggle="tab" class="text-center">注册</a></li>
        </ul>

        <div class="tab-content">
            <div class="login-box-body tab-pane active fade in" id="login_box">
                <form id="loginForm">
                    <div class="form-group has-feedback">
                        <input type="text" name="username" class="form-control" placeholder="用户名">
                        <span class="glyphicon glyphicon-user form-control-feedback"></span>
                    </div>
                    <div class="form-group has-feedback">
                        <input type="password" name="password" class="form-control" placeholder="密码">
                        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                    </div>
                    <div class="row">
                        <div class="col-xs-8">
                            <div class="checkbox icheck">
                                <label>
                                    <input type="checkbox"> 记住我
                                </label>
                            </div>
                        </div>
                        <!-- /.col -->
                        <div class="col-xs-4">
                            <button type="button" onclick="login()" class="btn btn-primary btn-block btn-flat">登陆</button>
                        </div>
                        <!-- /.col -->
                    </div>
                </form>
                <hr>
                <p>没有账号？<a href="#">注册</a>，忘记密码？<a href="#">找回</a></p>
            </div>

            <div class="register-box-body tab-pane fade" id="register_box">
                <form>
                    <div class="form-group has-feedback">
                        <input type="text" name="username" class="form-control" placeholder="用户名">
                        <span class="glyphicon glyphicon-user form-control-feedback"></span>
                    </div>
                    <div class="form-group has-feedback">
                        <input type="password" name="password" class="form-control" placeholder="密码">
                        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                    </div>
                    <div class="form-group has-feedback">
                        <input type="password" class="form-control" placeholder="再输入一次密码">
                        <span class="glyphicon glyphicon-log-in form-control-feedback"></span>
                    </div>
                    <div class="row">
                        <div class="col-xs-8">
                            <div class="checkbox icheck">
                                <label>
                                    <input type="checkbox"> 我已阅读并同意该<a href="#">协议</a>
                                </label>
                            </div>
                        </div>
                        <!-- /.col -->
                        <div class="col-xs-4">
                            <button type="submit" class="btn btn-primary btn-block btn-flat" disabled>无法注册</button>
                        </div>
                        <!-- /.col -->
                    </div>
                </form>

                <#--<div class="social-auth-links text-center">-->
                    <#--<p>- OR -</p>-->
                    <#--<a href="#" class="btn btn-block btn-social btn-facebook btn-flat"><i class="fa fa-facebook"></i> Sign up using-->
                        <#--Facebook</a>-->
                    <#--<a href="#" class="btn btn-block btn-social btn-google btn-flat"><i class="fa fa-google-plus"></i> Sign up using-->
                        <#--Google+</a>-->
                <#--</div>-->

                <#--<a href="login.html" class="text-center">I already have a membership</a>-->
            </div>
        </div>
    </div>

</div>
<!-- /.login-box -->

<script src="/plugin/jquery-3.2.1/jquery.js"></script>
<script src="/plugin/bootstrap-3.3.7/js/bootstrap.js"></script>
<script src="/plugin/icheck-1.0.2/icheck.js"></script>
<script src="/plugin/layer-3.0.3/layer.js"></script>

<script>

    $(function () {
        $('.icheck input').iCheck({
            checkboxClass: 'icheckbox_square-blue',
            radioClass: 'iradio_square-blue',
            increaseArea: '20%' // optional
        });

    });

    function login() {
        var lodLndex = layer.load(1, {shade: [0.3, '#393D49']});
        $.post("/admin/login?" + $("#loginForm").serialize(), null, function (d) {
            if (d.success) {
                location.href = "/admin";
            } else {
                layer.close(lodLndex);
                layer.msg(d.msg);
            }
        },"json");
    }
</script>
</body>
</html>
